<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>项目里程碑设置</title>
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
    <!--页面样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <style>
        .myDataCentere ul li label{
            width: 20%;
        }
    </style>
</head>
<body class="whitebg">
<div class="myDataCentere mydataCentere-small" style="height: 172px">
    <ul class="clearfix" >
        <li class="clearfix">
            <label class="fl">项目类型</label>
            <input type="text" name="projectType" id="projectType" lay-verify="projectType"
                   class="fl" value="${type.badtName}">
            <input type="hidden" name="badtNo" id="badtNo" value="${type.badtNo}">
            <input type="hidden" name="badtCode" id="badtCode" value="${type.badtCode}">
            <input type="hidden" name="badtTypecode" id="badtTypecode" value="${type.badtTypecode}">

        </li>
    </ul>
</div>

<div style="background-color: white;background-color: white;padding: 15px;text-align: center;position: fixed;bottom: 1px;width: 100%;">
    <button class="layui-btn layui-btn-sm" lay-filter="submitType" lay-submit type="button">更新</button>
    <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" id="close">取消</button>
</div>

<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script>
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        $('#close').click(function(){
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        //监听提交

        form.on('submit(submitType)', function(data){
            var projectType = $('#projectType').val();
            var badtCode = $('#badtCode').val();
            var badtNo = $('#badtNo').val();
            var badtTypecode = $('#badtTypecode').val();
            var json = {
                badtName: projectType,
                badtCode:badtCode,
                badtNo:badtNo,
                badtTypecode:badtTypecode
            }
            layerAjax('/adminManager/supervisor/milepostManager/updateTypeValue',json, '',
                function (d) {
                    if (d.flag == true) {
                        parent.layer.msg(d.msg, {icon: 1});
                        // layui.table.reload('typeList');
                        parent.flushTypeList();
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    } else {
                        layer.msg(d.msg, {icon: 2});
                    }
                });
            return false;
        });
    });
</script>
</body>
</html>